package myJs.myPkg

import myJs.myPkg.jsext._

import scala.scalajs.js
import myJs.Utils._
import slinky.readwrite.ObjectOrWritten

import scala.scalajs.js.Dynamic.{global => g}

/**
  * Created by yz on 2019/3/14
  */
package object Swal {

  def swal(options: ObjectOrWritten[SwalOptions]) = g.swal(options)

  def swal(options: ObjectOrWritten[SwalOptions], f: js.Function) = g.swal(options, f)

  def close() = g.swal.close()

}



case class SwalOptions(
  text: js.UndefOr[String] = js.undefined,
  title: js.UndefOr[String] = js.undefined,
  `type`: js.UndefOr[String] = js.undefined,
  showCancelButton: js.UndefOr[Boolean] = js.undefined,
  showConfirmButton: js.UndefOr[Boolean] = js.undefined,
  confirmButtonClass: js.UndefOr[String] = js.undefined,
  confirmButtonText: js.UndefOr[String] = js.undefined,
  closeOnConfirm: js.UndefOr[Boolean] = js.undefined,
  cancelButtonText: js.UndefOr[String] = js.undefined,
  cancelButtonClass: js.UndefOr[String] = js.undefined,
  showLoaderOnConfirm: js.UndefOr[Boolean] = js.undefined,
)
